package chances.wechat.entity;

import java.util.Date;

public class QrCodeInfo implements java.io.Serializable {
	public static final Integer SAVE_ERROR = 2;
	public static final Integer SAVE_OK = 1;
	public static final Integer CREATE_ERROR = 3;
	public static final Integer INIT = 0;
	public static final Integer CREATE = 0;
	public static final Integer SCAN = 2;
	private static final long serialVersionUID = -7129604833114195308L;
	private Long id;
	private String qrInfo;
	private String stbNo;
	private String scene;
	private String location;
	private int status;
	private Date createTime;
	private Date scanTime;
	private String url;
	private Date updateTime;
	private int scanCount;
	
	public QrCodeInfo(String stbNo, String scene, String location) {
		this.stbNo = stbNo;
		this.location = location;
		this.scene = scene;
		this.qrInfo = genScene(this);
		this.updateTime = new Date();
		this.createTime = new Date();
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public QrCodeInfo() {
		super();
	}

	

	public String getStbNo() {
		return stbNo;
	}

	public void setStbNo(String stbNo) {
		this.stbNo = stbNo;
	}

	public void setScene(String scene) {
		this.scene = scene;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getQrInfo() {
		return qrInfo;
	}

	public void setQrInfo(String qrInfo) {
		this.qrInfo = qrInfo;
	}



	public String getScene() {
		return this.scene;
	}



	public static String genScene(QrCodeInfo qrCodeInfo) {
		int hash = (qrCodeInfo.location + "_" + qrCodeInfo.stbNo).hashCode();
		long longValue = hash & 0X0FFFFFFFFL;
		return ""+longValue;

	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public int getScanCount() {
		return scanCount;
	}

	public void setScanCount(int scanCount) {
		this.scanCount = scanCount;
	}


	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}


	public Date getScanTime() {
		return scanTime;
	}

	public void setScanTime(Date scanTime) {
		this.scanTime = scanTime;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
}
